package com.example.demo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: H_tao_X
 * Date: 2022-07-17
 * Time: 20:48
 */

@Component // 将对象 注入 spring boot 中
public class ReadYml {

    // 读取一下 properties
//    @Value("${string.value}")
//    private String hello;// 接收 读取配置文件中的内容

    // 读取 yml
    @Value("${mystring1}")
    private String hello1;


    @PostConstruct
    public void ReadYml() {
//        System.out.println("打印一下啊！:" + hello);
        System.out.println("yml 打印啊 :" + hello1);
    }
}
